package com.ruihu.admin.module.business.task.domain.vo;

import com.ruihu.admin.module.business.task.domain.dto.SubtaskDefectDTO;
import lombok.Data;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;

/**
 *  [ 电芯缺陷关系表 ]
 *
 * @author Tony
 * @version 1.0
 * @company 瑞虎（南京）信息技术有限公司
 * @copyright (c) 瑞虎（南京）信息技术有限公司Inc. All rights reserved.
 * @date  2022-09-22 13:42:27
 * @since JDK1.8
 */

@Data
public class SubtaskDefectVO {
    @ApiModelProperty("id")
    private Long id;

    @ApiModelProperty("sub_task_id")
    private Long subTaskId;

    @ApiModelProperty("task_node_inst_id")
    private Long taskNodeInstId;

    @ApiModelProperty("defect_type_id")
    private Long defectTypeId;

    @ApiModelProperty("revision")
    private Integer revision;

    @ApiModelProperty("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty("create_by")
    private Integer createBy;

    @ApiModelProperty("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @ApiModelProperty("update_by")
    private Integer updateBy;


    public static SubtaskDefectVO convertToSubtaskDefectVO(SubtaskDefectDTO dto) {
        if (dto == null){
            return null;
        }
        SubtaskDefectVO vo = new SubtaskDefectVO();
        vo.setId(dto.getId());
        vo.setSubTaskId(dto.getSubTaskId());
        vo.setDefectTypeId(dto.getDefectTypeId());
        vo.setCreateTime(dto.getCreateTime());
        vo.setUpdateTime(dto.getUpdateTime());
        return vo;
    }
}
